<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::namespace('user')->group(function () {
    Route::prefix('user')->middleware('UserMiddleware')->group(function () {
        Route::get('user_info_refresh','UsersController@userInfo');
        Route::post('set_pay_pass','UsersController@set_pay_pass');
        Route::post('set_login_pass','UsersController@set_login_pass');
        Route::post('update_user_data','UsersController@update_user_data');
        Route::post('money_to_users','UsersController@moneyToUsers');



        Route::get('address','AddressController@address');
        Route::post('add_address','AddressController@add_address');
        Route::post('update_address','AddressController@update_address');
        Route::post('del_address','AddressController@del_address');
        Route::post('set_default','AddressController@set_default');
        Route::post('orders','OrdersController@orders');
        Route::get('orders_info','OrdersController@orders_info');
        Route::get('order_scan_code_confirm','OrdersController@order_scan_code_confirm');
        Route::post('orders_create','OrdersController@order_create');
        Route::post('update_user_info','OrdersController@update_user_info');

        Route::get('moneys_logs','CommonController@moneys_logs');
        Route::get('test','CommonController@test');
        Route::post('wechat_login','UsersController@wechatLogin');



        Route::post('set_card_json','UsersController@setCardJson');
        Route::post('withdrawal','UsersController@withdrawal');
        Route::get('my_lines','BusinessesController@myLines');
        Route::post('pay','BusinessesController@pay');
        Route::post('quit_order','BusinessesController@quitOrder');

    });


    Route::prefix('user')->group(function (){
        Route::post('qr_code','BusinessesController@qr_code');
        Route::post('login','UsersController@login');
        Route::post('register','UsersController@register');
        Route::post('sms_send','CommonController@sms_send');
        //商品列表
        Route::get('categorys','CategorysController@categorys');
        Route::get('cursors','CommonController@cursors');
        Route::get('goods','GoodsController@goods');
        Route::get('info','GoodsController@info');
        Route::get('every_day_price','TaskController@everyDayPrice');


        Route::any('notice_pay_price','NoticeController@notice_pay_price')->name('admin.notice_pay_price');
        Route::any('notice_pay_price_order','NoticeController@notice_pay_price_order')->name('admin.notice_pay_price_order');
        Route::get('sciences','SciencesController@sciences');
        Route::get('sciences_info','SciencesController@info');
        Route::get('shops','CommonController@shops');
        Route::get('shops_info','CommonController@shopInfo');
        Route::get('areas','AddressController@areas');
        Route::get('lines','BusinessesController@lines');
        Route::get('lines_ranking','BusinessesController@lines_ranking');
        Route::get('settings','CommonController@settings');
    });
    Route::prefix('index')->group(function (){
        Route::any('file_up','CommonController@file_up');
    });
});
